<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * 系统设置/配制.
     */
    public function up(): void
    {
        Schema::create('systems', function (Blueprint $table) {
            $table->id();
            $table->string('key')->unique();
            $table->string('value');
            $table->boolean('is_cached')->default(false); // 新增是否缓存字段，默认为 false
        });

        Schema::create('system_adds', function (Blueprint $table) {
            $table->id();
            $table->string('key')->unique(); // 增加唯一约束
            $table->string('value');
            $table->boolean('is_cached')->default(false); // 新增是否缓存字段，默认为 false
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('systems');

        Schema::dropIfExists('system_adds');
    }
};
